/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Locale;

/**
 * <p>Project: javase - Exception1
 * <p>Powered by webrx On 2021-12-08 14:06:35
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Exception1 {
    public static void main(String[] args) {
        //try catch finally throw throws
        var i = "ok";
        int a = 3;
        int b = 0;
        int c = 0;
        int[] n = {1, 2, 3};
        String str = null;
        try {
            System.out.println(str.toLowerCase());//NullPointerException
            System.out.println(n[1]); //ArrayIndexOutOfBoundsException
            c = a / b; //ArithmeticException
            System.out.println("111111111");
        } catch (Exception e) {
            e.printStackTrace();
            //System.out.println("程序有异常：" + e.getMessage());
        }

        System.out.println("ok");
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);


    }
}
